package demo.java.springboot.thymeleaf;

import java.util.Arrays;
import java.util.Map;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
public class HomeController {
	private static Logger LOG = LogManager.getLogger(HomeController.class);
	
	@GetMapping("/thymeleaf")
	String toHome (Map<String, Object>map) {
		// request.setAttribute("title", "xxxx");
		map.put("title", "thymeleaf demo");
		map.put("content", "hello, thymeleaf...");
		map.put("contents", Arrays.asList("content1", "content2", "content3"));
		return "pages/page";
	}
}
